-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix ground primitives crossing IDL in 2D #6984
Conversation
Thanks for the pull request @likangning93!
Reviewers, don't forget to make sure that:
I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); | ||
planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); | ||
planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a branchless equivalent to:
if (planes2D_high.x > planes2D_high.w) {
// If the primitive is split across the IDL
if (position3DLow.y > 0.0) { // Comparison with position3DHigh may produce artifacts
// If this vertex is on the east side of the IDL:
// - existing "east" is on the wrong side of the world, far away
// - set "east" as beyond the eastmost extent of the projection
planes2D_high.w = EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w);
planes2D_low.w = EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w);
} else {
// If this vertex is on the west side of the IDL:
// - existing "west" is on the wrong side of the world, far away
// - set "west" as beyond the westmost extent of the projection
planes2D_high.x = WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x);
planes2D_low.x = WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x);
}
}
Gist of what the problem was:
Gist of the fix:
|
Just a reminder that if we want this in for the next release, it should be merged today. |
👍 Don't forget about the issue where the volumes need to be closed 😃 |
Fixes #6951
In Sandcastle